﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Common;
using System.Data;

namespace ConsoleApplication
{
    public class UserRepository
    {
        public DataTable GetByDataTable()
        {
            DataTable dt = new DataTable("user");
            dt.Columns.Add("Id", typeof(int));
            dt.Columns.Add("Name", typeof(string));
            dt.Columns.Add("Address", typeof(string));

            DataRow dr = null;
            for (int i = 0; i < 20; i++)
            {
                dr = dt.NewRow();
                dr["Id"] = i;
                dr["Name"] = "Name" + i;
                dr["Address"] = "Address" + i;

                dt.Rows.Add(dr);
            }
            dt.AcceptChanges();

            return dt;
        }
    }
}
